<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c_rt" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fmt_rt" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
<%@ taglib prefix="x_rt" uri="http://java.sun.com/jstl/xml_rt"%>
<%@ taglib prefix="wr_fn" uri="http://njo.org/taglib/functions"%>
<form name="f1" action="" method="post">
<table width="98%">
  <tr>
    <td class="left"><a name="title"><b>字段列表</b></a></td>
    <td class="right">
      <a href="${pageContext.request.contextPath}/importfield.tiles?processor=/processor.importfield.tiles">导入</a>
      <a href="javascript:document.f1.action='${pageContext.request.contextPath}/processor.exportfield.tiles'; document.f1.submit();">导出</a>
      <a href="${pageContext.request.contextPath}/processor.prenewfield.tiles">添加字段</a>
      <a href="javascript:document.f1.action='${pageContext.request.contextPath}/processor.deletefield.tiles'; document.f1.submit();">删除字段</a>
    </td>
  </tr>
</table>
<c:set var="actionMessages" value="${wr_fn:amessages(pageContext, '')}"/>
<c:forEach items="${actionMessages}" var="item">
    <div class="error-content">${wr_fn:message(pageContext, item.key, item.values)}</div>
</c:forEach>
<table class="forum" width="98%">
<col width="10"/>
<col width="150"/>
<col width="150"/>
<col width="*"/>
<tbody>
  <tr>
    <th>&nbsp;</th>
    <th>Name</th>
    <th>Value</th>
    <th>Description</th>
  </tr>
<c:forEach items="${fieldList}" var="item" varStatus="itemStatus">
  <tr class="${(itemStatus.index%2==0) ? 'even' : 'odd'}">
    <td><input type="checkbox" name="fields" value="${item.field_physical_name}"/></td>
    <td><a href="${pageContext.request.contextPath}/processor.loadfield.tiles?name=${item.field_physical_name}">${item.field_physical_name}</a></td>
    <c:set var="f_l_" value="${wr_fn:isEmpty(item.field_size) ? '' : '('}"/>
    <c:set var="f_r_" value="${wr_fn:isEmpty(item.field_size) ? '' : ')'}"/>
    <td class="left">${item.field_type}${f_l_}${wr_fn:isEmpty(item.field_size) ? '' : item.field_size}${f_r_}</td>
    <td class="left">${item.field_description}</td>
  </tr>
</c:forEach>
</tbody>
</table>
</form>